package com.zhousb.deviceManager.model.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author ZhouShenBin
 * @date 2024/6/27 17:51
 * @description
 */
@Getter
@AllArgsConstructor
public enum OrderTypeEnum {

    DEFAULT(-1, "默认"),
    TEMP(0,"临时出库"),
    PERPETUAL(1,"永久出库")
    ;
    private Integer code;
    private String name;

    public String getNameByCode(Integer code) {
        for (OrderTypeEnum _enum : OrderTypeEnum.values()) {
            if (_enum.getCode().equals(code)) {
                return _enum.getName();
            }
        }
        return DEFAULT.getName();
    }
}
